//
//  BaseView.m
//  Golf
//
//  Created by 刘俊 on 16/4/14.
//  Copyright © 2016年 刘俊. All rights reserved.
//

#import "BaseView.h"

@interface BaseView (){
    MBProgressHUD *_HUD;/**< 提示语,网络请求的*/
}

@end

@implementation BaseView


#pragma mark -
#pragma mark - UI操作

/**
 *  xib初始化
 *
 *  @return 返回实例
 */
+ (instancetype)view {
    return [[NSBundle mainBundle]loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil].firstObject;
}

/**
 *  创建子视图
 */
- (void)creatUI {
    
}

/**
 *  更新UI
 */
- (void)updateUI {
    
}

/**
 *  传入模型
 *
 *  @param model 模型
 */
- (void)fillContentWithModel:(id)model {
    
}

#pragma mark -
#pragma mark - HUD操作
- (void)showHUDWithInfo:(NSString *)info AfterDelay:(NSTimeInterval)delyay {
    MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:kKeyWindow animated:YES];
    HUD.mode = MBProgressHUDModeIndeterminate;
    HUD.labelText = info;
    if (delyay == 0) {
        delyay = 1.f;
    }
    [HUD hide:YES afterDelay:delyay];
}



@end
